<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>卸货地址管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$(".close,.closeBtn").click(function(){
				$("#formDispach").addClass("hide");
			    $("#maskY").addClass("hide");
	        	$("#listData").html("");
	        });		
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
        /**
		* 卸货公司的详情
		* id 获取到的收货公司的id
	    */
        function address_list(id){
         $.ajax({
        	url:"${ctx}/tb_discharge_cargo_address/tbDischargeCargoAddress/addressDetails",
        	type: "post",
		    data:{
		        	id:id
				},
        	 dataType:"json",
        	 success: function (data) {  	
	        		if(data!=null){
			        	for(var i=0;i<data.length;i++){		        
			        		var ad = data[i];			        		
			        		var listStr ="<ul class='tanUl'>"+
				        			"<li><h4>公&nbsp&nbsp&nbsp司&nbsp&nbsp&nbsp名&nbsp&nbsp&nbsp称："+ad.name+"</h4></li>"+
				        			"<li><h4>公&nbsp&nbsp&nbsp司&nbsp&nbsp&nbsp简&nbsp&nbsp&nbsp称："+ad.shortName+"</h4></li>"+
				        			"<li><h4>联&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp系&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp人："+ad.persion+"</h4></li>"+
				        			"<li><h4>联&nbsp&nbsp&nbsp系&nbsp&nbsp&nbsp电&nbsp&nbsp&nbsp话："+ad.tell+"</h4></li>"+
				        			"<li><h4>所&nbsp&nbsp&nbsp在&nbsp&nbsp&nbsp省&nbsp&nbsp&nbsp份："+ad.p.areaname+"</h4></li>"+
				        			"<li><h4>所&nbsp&nbsp&nbsp在&nbsp&nbsp&nbsp城&nbsp&nbsp&nbsp市："+ad.c.areaname+"</h4></li>"+
				        			"<li><h4>所&nbsp&nbsp&nbsp在&nbsp&nbsp&nbsp区&nbsp&nbsp&nbsp县："+ad.e.areaname+"</h4></li>"+
				        			"<li><h4>具&nbsp&nbsp&nbsp体&nbsp&nbsp&nbsp地&nbsp&nbsp&nbsp址："+ad.addressNew+"</h4></li>"+
				        			"<li><h4>更&nbsp&nbsp&nbsp新&nbsp&nbsp&nbsp时&nbsp&nbsp&nbsp间："+ad.createDate+"</h4></li>"+
				        			"<li><h4>创&nbsp&nbsp&nbsp建&nbsp&nbsp&nbsp时&nbsp&nbsp&nbsp间："+ad.updateDate+"</h4></li>"+
				        			"<li><h4>更&nbsp&nbsp&nbsp新&nbsp&nbsp&nbsp人&nbsp&nbsp&nbsp员："+ad.y.name+"</h4></li>"+
				        			"<li><h4>创&nbsp&nbsp&nbsp建&nbsp&nbsp&nbsp人&nbsp&nbsp&nbsp员："+ad.s.name+"</h4></li>"+
			        		"</ul>";
			        	}
			        $("#listData").append(listStr);
			        }
		        }
		    });	
		    $(".tan").removeClass("hide"); 
		}   
	</script>
	<style type="text/css">
		/*弹窗样式*/
		#maskY{
            background: #000;
            opacity: 0.75;
            /*IE兼容*/
            filter: alpha(opacity=75);
            height: 1000px;
            width: 100%;
            position: absolute;
            left: 0;
            top: 0;
            /*z-index: 1000;*/
          }
          #formDispach{
            position: fixed;
            left: 30%;
            top: 5%;
            /*z-index:1100;*/
          }
          .formCon{
            width: auto;
            height: auto;
            background: #FFF;
            position: relative;
          }
          #listData>ul{
			list-style:none;
			margin:0;
		  }
		  .tanUl>li{
			margin-top: 10px;
			padding-left:27%;
			line-height:inherit;
			text-align:left;
		  }
		  .closeBtn{
		    margin-left: 89%;
		  }
	</style>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/tb_discharge_cargo_address/tbDischargeCargoAddress/">卸货地址列表</a></li>
		<shiro:hasPermission name="tb_discharge_cargo_address:tbDischargeCargoAddress:edit"><li><a href="${ctx}/tb_discharge_cargo_address/tbDischargeCargoAddress/form">卸货地址添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="tbDischargeCargoAddress" action="${ctx}/tb_discharge_cargo_address/tbDischargeCargoAddress/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>名称：</label>
				<form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
			</li>
			<li><label>简称：</label>
				<form:input path="shortName" htmlEscape="false" maxlength="25" class="input-medium"/>
			</li>
			<li><label>联系人：</label>
				<form:input path="persion" htmlEscape="false" maxlength="15" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>名称</th>
				<th>简称</th>
				<th>联系人</th>
				<th>联系电话</th>
				<th>详细地址</th>
				<th>更新时间</th>
				<th>备注</th>
				<shiro:hasPermission name="tb_discharge_cargo_address:tbDischargeCargoAddress:edit"><th>操作</th></shiro:hasPermission>
			</tr>			
		</thead>
		
		<tbody>
		<c:forEach items="${page.list}" var="tbDischargeCargoAddress">
			<tr>
				<td><a href="${ctx}/tb_discharge_cargo_address/tbDischargeCargoAddress/form?id=${tbDischargeCargoAddress.id}">
					${tbDischargeCargoAddress.name}
				</a></td>
				<td>
					${tbDischargeCargoAddress.shortName}
				</td>
				<td>
					${tbDischargeCargoAddress.persion}
				</td>
				<td>
					${tbDischargeCargoAddress.tell}
				</td>
				<td>
					${tbDischargeCargoAddress.address}
				</td>
				<td>
					<fmt:formatDate value="${tbDischargeCargoAddress.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${tbDischargeCargoAddress.remarks}
				</td>
				<shiro:hasPermission name="tb_discharge_cargo_address:tbDischargeCargoAddress:edit"><td>
    				<a href="${ctx}/tb_discharge_cargo_address/tbDischargeCargoAddress/form?id=${tbDischargeCargoAddress.id}">修改</a>
					<a href="${ctx}/tb_discharge_cargo_address/tbDischargeCargoAddress/delete?id=${tbDischargeCargoAddress.id}" onclick="return confirmx('确认要删除该卸货地址吗？', this.href)">删除</a>
					<a href="javascript:void(0);" onclick="address_list('${tbDischargeCargoAddress.id}')">查看详细信息</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>		
	</table>
	<%--弹窗 --%>
		<div class="tan hide" id="maskY"></div>
		<div class="tan hide nav-tabs-custom" id="formDispach" style="">
			<div class="formCon" style="">
			        <div class="input-group">
			          <div class="modal-dialog">
					  	 <div class="modal-content">
					          <div class="modal-header">
					            <button type="button" class="close" data-dismiss="modal" aria-label="Close"  >
					              <span aria-hidden="true">&times;</span></button>
					            <h4 class="modal-title">卸货公司详情</h4>
					          </div>
					          <section class="invoice" id="invoice_context">
					              <div id="listData"></div>
					          </section>          
					          <div class="modal-footer">
					            <button type="button" class="btn btn-default pull-left closeBtn" data-dismiss="modal" >取消</button>
					          </div>
					        </div>
				        </div>
		  			</div>
			</div>
  		</div>
  	<%--弹窗 end--%>
	<div class="pagination">${page}</div>
</body>
<!-- jQuery 2.2.3 -->
<script src="${adminLET }/plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="${adminLET }/https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
  $.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.6 -->
<script src="${adminLET }/bootstrap/js/bootstrap.min.js"></script>
<!-- Morris.js charts -->
<script src="${adminLET }/https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="${adminLET }/plugins/morris/morris.min.js"></script>
<!-- Sparkline -->
<script src="${adminLET }/plugins/sparkline/jquery.sparkline.min.js"></script>
<!-- jvectormap -->
<script src="${adminLET }/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="${adminLET }/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<!-- jQuery Knob Chart -->
<script src="${adminLET }/plugins/knob/jquery.knob.js"></script>
<!-- daterangepicker -->
<script src="${adminLET }/https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.2/moment.min.js"></script>
<script src="${adminLET }/plugins/daterangepicker/daterangepicker.js"></script>
<!-- datepicker -->
<script src="${adminLET }/plugins/datepicker/bootstrap-datepicker.js"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="${adminLET }/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<!-- Slimscroll -->
<script src="${adminLET }/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="${adminLET }/plugins/fastclick/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="${adminLET }/dist/js/app.min.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="${adminLET }/dist/js/pages/dashboard.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="${adminLET }/dist/js/demo.js"></script>
</html>